<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>C MIP-SDK: mip.c File Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">C MIP-SDK
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">mip.c File Reference</div>  </div>
</div>
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="mip_8h_source.html">mip.h</a>&quot;</code><br/>
</div><table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip_8c.html#a39c9159abefed6cefdebf167ec2b426a">mip_init</a> (u8 *mip_buffer, u16 buffer_size, u8 descriptor_set)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip_8c.html#a94c9e41908a93a17985732862efe7221">mip_is_initialized</a> (u8 *mip_buffer, u8 descriptor_set)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip_8c.html#ab6af2990e4f14a36b3210490d4dc0279">mip_add_field</a> (u8 *mip_buffer, u16 buffer_size, void *field_data, u16 data_size, u16 data_descriptor)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip_8c.html#aa5f586b255fb0f64c58aa9876e998203">mip_add_formatted_field</a> (u8 *mip_buffer, u16 buffer_size, void *field)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip_8c.html#a4de18b339d9cc11650deb27c62d080ed">mip_finalize</a> (u8 *mip_buffer)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip_8c.html#a6a52f4d47ddeb106a137e35c50d161c4">mip_is_mip_packet</a> (u8 *mip_buffer)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip_8c.html#a7ba55d41fda2df7bb6ca437c7d46d9bf">mip_get_packet_size</a> (u8 *mip_buffer)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip_8c.html#a47b460bcec9fa9d05c797582aa41f91e">mip_get_first_field</a> (u8 *mip_buffer, <a class="el" href="struct__mip__field__header.html">mip_field_header</a> **field_header, u8 **field_data, u16 *field_offset)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip_8c.html#a0391cad812bc7d6d68cd0fd565a01942">mip_get_next_field</a> (u8 *mip_buffer, <a class="el" href="struct__mip__field__header.html">mip_field_header</a> **field_header, u8 **field_data, u16 *field_offset)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip_8c.html#ac914a614fb6032f829bc5652cff73dd9">mip_get_packet_descriptor_set</a> (u8 *mip_buffer)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip_8c.html#a002fe05192a78b81647c94c1581f388f">mip_get_payload_size</a> (u8 *mip_buffer)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u8 *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip_8c.html#aca1b26196bcbfdc8e2645fde7a8ffefc">mip_get_payload_ptr</a> (u8 *mip_buffer)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip_8c.html#a861285e29cf3ea99245931955d638892">mip_is_checksum_valid</a> (u8 *mip_buffer)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u16&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mip_8c.html#a65038bab666dc3aab060e6ca3ad2ba00">mip_calculate_checksum</a> (u8 *mip_buffer)</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><dl class="author"><dt><b>Author:</b></dt><dd>Nathan Miller </dd></dl>
<dl class="version"><dt><b>Version:</b></dt><dd>1.1 </dd></dl>
</div><hr/><h2>Function Documentation</h2>
<a class="anchor" id="ab6af2990e4f14a36b3210490d4dc0279"></a><!-- doxytag: member="mip.c::mip_add_field" ref="ab6af2990e4f14a36b3210490d4dc0279" args="(u8 *mip_buffer, u16 buffer_size, void *field_data, u16 data_size, u16 data_descriptor)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16 mip_add_field </td>
          <td>(</td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>mip_buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>buffer_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>field_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>data_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>data_descriptor</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>Adds a field to an initialized MIP packet buffer. </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">u8</td><td>*mip_buffer - pointer to memory used to construct the mip packet. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u16</td><td>buffer_size - size of the mip mempory buffer. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">void</td><td>*field_data - buffer containing the field data. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>u16 data_size - size of the field data (exlcuding the field header). </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>u16 data_descriptor - the data descriptor for the field. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">MIP_OK</td><td>- field added to MIP packet.<br/>
 </td></tr>
    <tr><td class="paramname">MIP_ERROR</td><td>- A pointer is NULL.<br/>
 </td></tr>
    <tr><td class="paramname">MIP_MEMORY_ERROR</td><td>- Not enough room in the mip buffer to add the field or<br/>
 the packet will be too large for a MIP. </td></tr>
  </table>
  </dd>
</dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p>None </p>

</div>
</div>
<a class="anchor" id="aa5f586b255fb0f64c58aa9876e998203"></a><!-- doxytag: member="mip.c::mip_add_formatted_field" ref="aa5f586b255fb0f64c58aa9876e998203" args="(u8 *mip_buffer, u16 buffer_size, void *field)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16 mip_add_formatted_field </td>
          <td>(</td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>mip_buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>buffer_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>field</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>Adds a pre-formatted field (header and data already assembled) to an initialized MIP packet buffer. </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">u8</td><td>*mip_buffer - pointer to memory used to construct the mip packet. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u16</td><td>buffer_size - size of the mip mempory buffer. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">void</td><td>*field - buffer containing the field (must have header and data already assembled). </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">MIP_OK</td><td>- field added to MIP packet.<br/>
 </td></tr>
    <tr><td class="paramname">MIP_ERROR</td><td>- A pointer is NULL.<br/>
 </td></tr>
    <tr><td class="paramname">MIP_MEMORY_ERROR</td><td>- Not enough room in the mip buffer to add the field or<br/>
 the packet will be too large for a MIP. </td></tr>
  </table>
  </dd>
</dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p>None </p>

</div>
</div>
<a class="anchor" id="a65038bab666dc3aab060e6ca3ad2ba00"></a><!-- doxytag: member="mip.c::mip_calculate_checksum" ref="a65038bab666dc3aab060e6ca3ad2ba00" args="(u8 *mip_buffer)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16 mip_calculate_checksum </td>
          <td>(</td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>mip_buffer</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>Calculates the 16-bit Fletcher checksum for the MIP packet. </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>*mip_buffer - pointer to memory containing the mip packet. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The MIP packet checksum, if mip_buffer contains a valid MIP packet.<br/>
 0x00 otherwise. </dd></dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p>None </p>

</div>
</div>
<a class="anchor" id="a4de18b339d9cc11650deb27c62d080ed"></a><!-- doxytag: member="mip.c::mip_finalize" ref="a4de18b339d9cc11650deb27c62d080ed" args="(u8 *mip_buffer)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16 mip_finalize </td>
          <td>(</td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>mip_buffer</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>Calculates the MIP checksum and updates the checksum field in the buffer. </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">u8</td><td>*mip_buffer - pointer to memory used to construct the mip packet. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Size of the MIP Packet in bytes. </dd></dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p>None </p>

</div>
</div>
<a class="anchor" id="a47b460bcec9fa9d05c797582aa41f91e"></a><!-- doxytag: member="mip.c::mip_get_first_field" ref="a47b460bcec9fa9d05c797582aa41f91e" args="(u8 *mip_buffer, mip_field_header **field_header, u8 **field_data, u16 *field_offset)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16 mip_get_first_field </td>
          <td>(</td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>mip_buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct__mip__field__header.html">mip_field_header</a> **&#160;</td>
          <td class="paramname"><em>field_header</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 **&#160;</td>
          <td class="paramname"><em>field_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16 *&#160;</td>
          <td class="paramname"><em>field_offset</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>Gets the first MIP field (a wrapper for mip_get_next_field that makes it easier to use). </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>*mip_buffer - pointer to memory containing the mip packet. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">mip_field_header</td><td>**field_header - pointer to the first field header. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">u8</td><td>**field_data - pointer to the first field data. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">u16</td><td>*field_offset - integer offset from start of packet payload of first field. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>See mip_get_next_field definition. </dd></dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p>None </p>

</div>
</div>
<a class="anchor" id="a0391cad812bc7d6d68cd0fd565a01942"></a><!-- doxytag: member="mip.c::mip_get_next_field" ref="a0391cad812bc7d6d68cd0fd565a01942" args="(u8 *mip_buffer, mip_field_header **field_header, u8 **field_data, u16 *field_offset)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16 mip_get_next_field </td>
          <td>(</td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>mip_buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct__mip__field__header.html">mip_field_header</a> **&#160;</td>
          <td class="paramname"><em>field_header</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 **&#160;</td>
          <td class="paramname"><em>field_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16 *&#160;</td>
          <td class="paramname"><em>field_offset</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>Gets the next data field at <code>field_offset</code>. </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>*mip_buffer - pointer to memory containing the mip packet. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">mip_field_header</td><td>**field_header - pointer to the current field header. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">u8</td><td>**field_data - pointer to the current field data. </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">u16</td><td>*field_offset - integer offset from start of packet payload of next field. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">MIP_OK</td><td>- c\ field_header and <code>field_data</code> contain the parsed information.<br/>
 </td></tr>
    <tr><td class="paramname">MIP_ERROR</td><td>- A pointer is NULL.<br/>
 </td></tr>
    <tr><td class="paramname">MIP_INVALID_PACKET</td><td>- The buffer does not contain a valid MIP packet. </td></tr>
    <tr><td class="paramname">MIP_FIELD_NOT_AVAILABLE</td><td>- The requested field does not exist. </td></tr>
  </table>
  </dd>
</dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p>None </p>

</div>
</div>
<a class="anchor" id="ac914a614fb6032f829bc5652cff73dd9"></a><!-- doxytag: member="mip.c::mip_get_packet_descriptor_set" ref="ac914a614fb6032f829bc5652cff73dd9" args="(u8 *mip_buffer)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u8 mip_get_packet_descriptor_set </td>
          <td>(</td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>mip_buffer</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>Returns the MIP packet descriptor set. </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>*mip_buffer - pointer to memory containing the mip packet. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The MIP descriptor set byte if the buffer points to a valid packet.<br/>
 0x00 otherwise. </dd></dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p>None </p>

</div>
</div>
<a class="anchor" id="a7ba55d41fda2df7bb6ca437c7d46d9bf"></a><!-- doxytag: member="mip.c::mip_get_packet_size" ref="a7ba55d41fda2df7bb6ca437c7d46d9bf" args="(u8 *mip_buffer)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16 mip_get_packet_size </td>
          <td>(</td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>mip_buffer</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>Gets the size of the MIP packet. </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>*mip_buffer - pointer to memory containing the mip packet. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 - An error occurred<br/>
 Size of the MIP packet, otherwise </dd></dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p>None </p>

</div>
</div>
<a class="anchor" id="aca1b26196bcbfdc8e2645fde7a8ffefc"></a><!-- doxytag: member="mip.c::mip_get_payload_ptr" ref="aca1b26196bcbfdc8e2645fde7a8ffefc" args="(u8 *mip_buffer)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u8* mip_get_payload_ptr </td>
          <td>(</td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>mip_buffer</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>Returns a pointer to the start of the MIP payload data. </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>*mip_buffer - pointer to memory containing the mip packet. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A pointer to the MIP payload data.<br/>
 NULL otherwise. </dd></dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p>None </p>

</div>
</div>
<a class="anchor" id="a002fe05192a78b81647c94c1581f388f"></a><!-- doxytag: member="mip.c::mip_get_payload_size" ref="a002fe05192a78b81647c94c1581f388f" args="(u8 *mip_buffer)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u8 mip_get_payload_size </td>
          <td>(</td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>mip_buffer</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>Returns the MIP payload size. </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>*mip_buffer - pointer to memory containing the mip packet. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The MIP payload size if the buffer points to a valid packet.<br/>
 0x00 otherwise. </dd></dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p>None </p>

</div>
</div>
<a class="anchor" id="a39c9159abefed6cefdebf167ec2b426a"></a><!-- doxytag: member="mip.c::mip_init" ref="a39c9159abefed6cefdebf167ec2b426a" args="(u8 *mip_buffer, u16 buffer_size, u8 descriptor_set)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16 mip_init </td>
          <td>(</td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>mip_buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>buffer_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>descriptor_set</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>Initialize a MIP packet header. </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">u8</td><td>*mip_buffer - pointer to memory used to construct the mip packet. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u16</td><td>buffer_size - size of the mip memory buffer. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>descriptor_set - descriptor set field value. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">MIP_OK</td><td>- MIP packet initialized.<br/>
 </td></tr>
    <tr><td class="paramname">MIP_ERROR</td><td>- The pointer is NULL.<br/>
 </td></tr>
    <tr><td class="paramname">MIP_MEMORY_ERROR</td><td>- Not enough room in the mip buffer.<br/>
 </td></tr>
  </table>
  </dd>
</dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p>None </p>

</div>
</div>
<a class="anchor" id="a861285e29cf3ea99245931955d638892"></a><!-- doxytag: member="mip.c::mip_is_checksum_valid" ref="a861285e29cf3ea99245931955d638892" args="(u8 *mip_buffer)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16 mip_is_checksum_valid </td>
          <td>(</td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>mip_buffer</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>Returns the state of the MIP packet checksum. </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>*mip_buffer - pointer to memory containing the mip packet. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">MIP_OK</td><td>- The checksum is valid.<br/>
 </td></tr>
    <tr><td class="paramname">MIP_ERROR</td><td>- The pointer is NULL.<br/>
 </td></tr>
    <tr><td class="paramname">MIP_INVALID_PACKET</td><td>- The buffer does not contain a valid MIP packet. </td></tr>
  </table>
  </dd>
</dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p>None </p>

</div>
</div>
<a class="anchor" id="a94c9e41908a93a17985732862efe7221"></a><!-- doxytag: member="mip.c::mip_is_initialized" ref="a94c9e41908a93a17985732862efe7221" args="(u8 *mip_buffer, u8 descriptor_set)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16 mip_is_initialized </td>
          <td>(</td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>mip_buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>descriptor_set</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>Check if a MIP packet is initialized. </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>*mip_buffer - pointer to memory used to construct the mip packet. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">u8</td><td>descriptor_set - expected descriptor set field value. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">MIP_OK</td><td>- MIP packet initialized.<br/>
 </td></tr>
    <tr><td class="paramname">MIP_ERROR</td><td>- The pointer is NULL or the MIP packet is not intialized.<br/>
 </td></tr>
  </table>
  </dd>
</dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p>None </p>

</div>
</div>
<a class="anchor" id="a6a52f4d47ddeb106a137e35c50d161c4"></a><!-- doxytag: member="mip.c::mip_is_mip_packet" ref="a6a52f4d47ddeb106a137e35c50d161c4" args="(u8 *mip_buffer)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u16 mip_is_mip_packet </td>
          <td>(</td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>mip_buffer</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<h2><a class="anchor" id="DESCRIPTION"></a>
DESCRIPTION</h2>
<p>Checks if the buffer contains a valid MIP header. </p>
<h2><a class="anchor" id="DETAILS"></a>
DETAILS</h2>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">u8</td><td>*mip_buffer - pointer to memory containing the mip packet. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">MIP_OK</td><td>- Header is valid.<br/>
 </td></tr>
    <tr><td class="paramname">MIP_ERROR</td><td>- The pointer is NULL.<br/>
 </td></tr>
    <tr><td class="paramname">MIP_MEMORY_ERROR</td><td>- The buffer does not contain a valid MIP packet header. </td></tr>
  </table>
  </dd>
</dl>
<h2><a class="anchor" id="NOTES"></a>
NOTES</h2>
<p>None </p>

</div>
</div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Fri May 30 2014 17:03:33 for C MIP-SDK by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
